impl Solution {
    pub fn kth_palindrome(queries: Vec<i32>, int_length: i32) -> Vec<i64> {
        let mut ans=Vec::<i64>::with_capacity(queries.len());
        for i in queries{
            ans.push(Solution::get_palindrome(i, int_length));
        }
        ans
    }
    pub fn get_palindrome(th :i32,int_len :i32)->i64{
        if int_len%2==0{
            let mut l=int_len/2;
             if 9_i64*(10_i64.pow((l-1) as u32 ))<th as i64{
                return -1;
            }
            let mut p=10_i64.pow((l-1)as u32)+th as i64-1_i64;
            let mut cp=p;
            p*=10_i64.pow(l as u32);
            l-=1;
            while cp>0{
                p+=10_i64.pow(l as u32)*(cp%10);
                l-=1;
                cp/=10;
            }
            p
        }else{
            let mut l =int_len/2+1;
            if 9_i64*(10_i64.pow((l-1) as u32 ))<th as i64{
                return -1;
            }
            let mut p :i64=10_i64.pow((l-1) as u32)+th as i64 -1;
            let mut cp=p/10;
            p*=10_i64.pow((l-1) as u32);
            l-=2;
            while cp>0{
                p+=10_i64.pow(l as u32)*(cp%10);
               
                l-=1;
                cp/=10;
            }
            p
        }
    }
}